<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"%>
<%@include file="/context/mytags.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta charset="UTF-8" />
<title>Highcharts 教程 | 菜鸟教程(runoob.com)</title>
<script src="http://apps.bdimg.com/libs/jquery/2.1.4/jquery.min.js"></script>
<script src="http://code.highcharts.com/highcharts.js"></script>
<script type="text/javascript">
	// 项目访问根目录
	var webRoot = '${webRoot}';
</script>
</head>
<body>
	<div id="container" style="width: 100%; height: 400px; margin: 0 auto"></div>
	<script language="JavaScript">
		$(document).ready(function() {

			$.ajax({
				type : 'post',
				url : webRoot + '/ordert/ebaychart1',
				dataType : 'json',
				success : function(data) {

					var title = {
						text : '销量统计'
					};
					var subtitle = {
						text : ''
					};
					var xAxis = {
						categories : data.arryear
					};
					var yAxis = {
						title : {
							text : ''
						},
						plotLines : [ {
							value : 0,
							width : 1,
							color : '#808080'
						} ]
					};

					var tooltip = {
						valueSuffix : ''
					}

					var legend = {
						layout : 'vertical',
						align : 'right',
						verticalAlign : 'middle',
						borderWidth : 0
					};

					var series = [ {
						name : 'EBay',
						data : data.arr
					}, {
						name : '手工',
						data : data.arr2
					}, {
						name : '亚马逊',
						data : data.arr1
					} ];

					var json = {};

					json.title = title;
					json.subtitle = subtitle;
					json.xAxis = xAxis;
					json.yAxis = yAxis;
					json.tooltip = tooltip;
					json.legend = legend;
					json.series = series;

					$('#container').highcharts(json);

				}
			});

		});
	</script>
</body>
</html>